#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

/* Typedefs */

typedef uint32_t data_t;

/* Insertion sort */
void isort(data_t *left, data_t *right) 
{
  data_t *cur = left + 1;
  data_t val;
  data_t *index;
  while (cur <= right)
  {
      val = *cur;
      index = cur - 1;

      while (index >= left && *index > val)
      {
          *(index + 1) = *index;
          index--;
      }
      *(index + 1) = val;
      cur++;
  }
}

